package mysql

func CreateCart(cart Cart) (Cart, error) {
	res := db.Create(&cart)
	return cart, res.Error
}
func CreateCartGoods(goods CartGoods) (CartGoods, error) {
	res := db.Create(&goods)
	return goods, res.Error
}
func GetCartInfo(cart Cart) (Cart, error) {
	newCart := Cart{}
	res := db.Where(cart).First(&newCart)
	return newCart, res.Error
}
func GetCartGoodsInfo(cart CartGoods) ([]CartGoods, error) {
	var newCart []CartGoods
	res := db.Where(cart).Find(&newCart)
	return newCart, res.Error
}
